package com.blog.wu.myblog.dao;

import com.blog.wu.myblog.base.CrudDao;
import com.blog.wu.myblog.entity.Permission;
import com.blog.wu.myblog.entity.Role;
import com.blog.wu.myblog.entity.UserInfo;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;

public interface PermissionMapper extends CrudDao<Permission> {

    /**
     * 根据用户名查询权限
     *
     * @param userInfo
     * @return
     * @Date 2018/11/5 5:39 PM
     * @Author wuyanshen
     */
    List<Permission> findPermissions(UserInfo userInfo);

    /**
     * 根据角色id删除permission_role表
     *
     * @param roleId
     * @return boolean
     * @Date 2018/11/7 11:02 AM
     * @Author wuyanshen
     */
    int deletePR(String roleId);

    List<String> findPermissionRole(Role role);

    int deleteRolePermission(Permission permission);
}
